package com.ocom.payconfig.controller;

import com.ocom.common.constant.PayConfigUrl;
import com.ocom.common.request.payconfig.CcbPosDeviceRequest;
import com.ocom.common.request.payconfig.GetCcbPosListRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.utils.ResultUtil;
import com.ocom.payconfig.service.CcbPosInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ccb_pos_infoController
 *
 * @author js
 * @date 2023-10-04 18:04:10
 */
@RestController
public class CcbPosInfoController {

        @Autowired
        private CcbPosInfoService ccbPosInfoService;

        /**
         * 5.5 获取建行智慧生活柜台列表
         */
        @PostMapping(PayConfigUrl.Url_GetCcbPosList)
        public Result getCcbPosList(@RequestBody GetCcbPosListRequest request) {
//            Page<CcbPosInfo> page = ccbPosInfoService.selectCcbPosInfoPage(pageNumber, pageSize);
            return ccbPosInfoService.getCcbPosList(request.getComId(), request);
        }

        /**
         * 5.6 获取未绑定建行智慧生活设备列表
         * @param
         * @return
         */
        @PostMapping(PayConfigUrl.Url_GetCcbNoPosDeviceList)
        public Result getCcbNoPosDeviceList(@RequestBody GetCcbPosListRequest request) {
            Result ret = ccbPosInfoService.getCcbNoPosDeviceList(request.getComId(), request);
            return ret;
        }

        /**
         * 5.7 设备绑定建行智慧生活柜台
         */
        @PostMapping(PayConfigUrl.Url_BindCcbPosDevice)
        public Result bindCcbPosDevice(@RequestBody CcbPosDeviceRequest request) {
            Result ret = ccbPosInfoService.bindCcbPosDevice(request.getComId(), request);
            return ret;
        }

        /**
         * 5.8 设备解绑建行智慧生活柜台
         */
        @PostMapping(PayConfigUrl.Url_UnbindCcbPosDevice)
        public Result unbindCcbPosDevice(@RequestBody CcbPosDeviceRequest request) {
            Result ret = ccbPosInfoService.unbindCcbPosDevice(request.getComId(),request);
            return ret;
        }
}
